/**
 * Copyright &copy; 2012-2017 <a href="https://vivo.com">vivo</a> All rights reserved.
 */
package com.vivo.retail.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.vivo.retail.entity.ViDeaSnaction;
import com.vivo.retail.dao.ViDeaSnactionDao;

/**
 * 串号流向Service
 * @author jyangye
 * @version 2018-04-09
 */
@Service
@Transactional(readOnly = true)
public class ViDeaSnactionService extends CrudService<ViDeaSnactionDao, ViDeaSnaction> {
    @Autowired
    private ViDeaSnactionDao viDeaSnactionDao;

	public ViDeaSnaction get(String id) {
		return super.get(id);
	}

	public ViDeaSnaction get(ViDeaSnaction viDeaSnaction) {
	    return super.get(viDeaSnaction);
    }

    public ViDeaSnaction getLast(ViDeaSnaction viDeaSnaction) {
	    return viDeaSnactionDao.getLastChangeData(viDeaSnaction);
    }
	
	public List<ViDeaSnaction> findList(ViDeaSnaction viDeaSnaction) {
		return super.findList(viDeaSnaction);
	}
	
	public Page<ViDeaSnaction> findPage(Page<ViDeaSnaction> page, ViDeaSnaction viDeaSnaction) {
		return super.findPage(page, viDeaSnaction);
	}

	@Transactional(readOnly = false)
    public void insertByBatch(List<ViDeaSnaction> list, String area) {
	    if (area.equals("ah")) {
	        viDeaSnactionDao.insertByBatchAh(list);
        } else {
	        viDeaSnactionDao.insertByBatchJs(list);
        }
    }
	
	@Transactional(readOnly = false)
	public void save(ViDeaSnaction viDeaSnaction) {
		super.save(viDeaSnaction);
	}
	
	@Transactional(readOnly = false)
	public void delete(ViDeaSnaction viDeaSnaction) {
		super.delete(viDeaSnaction);
	}
	
}